if __name__ == "__main__":
    ls = []
    max_score = 0
    min_score = 0
    mean = 0
    with open("grade.txt", "r+") as text:
        for item in text.readlines():
            ls.append(int(item))
        max_score = max(ls)
        min_score = min(ls)
        mean = round(sum(ls) / len(ls),1)
    with open("result.txt", "w+") as result:
        result_list = [str(max_score)+"\n", str(min_score)+"\n", str(mean)+"\n"]
        result.writelines(result_list)
